package com.hui.blog_server.controller;

import com.hui.blog_server.entity.Blogs;
import com.hui.blog_server.entity.ResponseResult;
import com.hui.blog_server.entity.Tags;
import com.hui.blog_server.service.TagsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TagsController {

    private final TagsService tagsService;

    public TagsController(TagsService tagsService) {
        this.tagsService = tagsService;
    }

    @GetMapping("/tags")
    public ResponseResult<List<Tags>> blogs() {
        List<Tags> blogs = tagsService.getTags();
        return ResponseResult.success(blogs);
    }
}
